﻿using System;

namespace Bouyei.AlgoDemo
{
    using Bouyei.Algo.Graph;
    using System.Collections.Generic;

    class Program
    {
        static void Main(string[] args)
        {
            dijkstra();
        }

        static void dijkstra()
        {
            var None = DijkstraAlgorithm.NONE;
            int[,] graphs = {
                {None,None,10,None,30,100 },
                { None,None,5,None,None,None},
                { None,None,None,50,None,None},
                { None,None,None,None,None,10},
                { None,None,None,20,None,60},
                { None,None,None,None,None,None}
            };

            DijkstraAlgorithm dijkstra = new DijkstraAlgorithm(0, graphs);
            var dis = dijkstra.Execute();
            foreach(var dic in dis)
            {
                Console.WriteLine(dic.Value);
            }
            Console.ReadKey();
        }

        static void douglas()
        {
            List<DougNode> points = new List<DougNode>();

            points.Add(new DougNode(1, 4));
            points.Add(new DougNode(2, 3));
            points.Add(new DougNode(4, 2));
            points.Add(new DougNode(6, 6));
            points.Add(new DougNode(7, 7));
            points.Add(new DougNode(8, 6));
            points.Add(new DougNode(9, 5));
            points.Add(new DougNode(10, 10));
            points.Add(new DougNode(11, 10.5));
            points.Add(new DougNode(12, 14));
            points.Add(new DougNode(13, -10));

            DouglasAlgorithm douglas = new DouglasAlgorithm(points, 1);
            var ls = douglas.Execute();
            foreach (var dic in ls)
            {
                Console.WriteLine("x:"+dic.X+",y:"+dic.Y);
            }
            Console.ReadKey();
        }
    }
}
